
package com.bstek.urule.builder.resource;

import com.bstek.urule.model.table.DecisionTable;
import com.bstek.urule.parse.deserializer.DecisionTableDeserializer;
import org.dom4j.Element;

/**
 * @author Jacky.gao
 * @since 2015年2月9日
 */
public class DecisionTableResourceBuilder implements ResourceBuilder<DecisionTable> {
    private DecisionTableDeserializer decisionTableDeserializer;

    public DecisionTable build(Element root) {
        return decisionTableDeserializer.deserialize(root);
    }

    public ResourceType getType() {
        return ResourceType.DecisionTable;
    }

    public boolean support(Element root) {
        return decisionTableDeserializer.support(root);
    }

    public void setDecisionTableDeserializer(
            DecisionTableDeserializer decisionTableDeserializer) {
        this.decisionTableDeserializer = decisionTableDeserializer;
    }
}
